#pragma once

#include "datatypedefine.h"
#include "devicegroup.h"
#include <osg\ref_ptr>
#include <QList>
#include <QMap>
#include "materialeffect.h"
#include "commonshape.h"

namespace VrDataCore
{
	class Map;

	class VRDATACORE_EXPORT AreaActor:public DeviceGroup
	{
	public:
		AreaActor();

		virtual void buildPropertyMap();
		virtual void onMapLoadEnd(CoreBase::Map*);

		virtual void setTraverseMask(int mask);
		void groupChild(QVector<ActorBase*> childvector);
		void unGroupChild();
		void unGroupChild(QVector<ActorBase*> childvector);
		void showAreaEffect();
		void hideAreaEffect();
		void setAreaVertexData(QString data);
		void setAreaVertexData(std::vector<osg::Vec3> data,bool end);
		QString getAreaVertexData();
		void setAreaHeight(float height);
		float getAreaHeight();
		void setAreaColor(osg::Vec4 color);
		osg::Vec4 getAreaColor();
	protected:
		~AreaActor();
		void initialNode();
		virtual void createDrawable();
		osg::ref_ptr<MaterialEffect>							_materialEffect;
		QString													_vertexData;
		std::vector<osg::Vec3>									_vertexDataVector;
		float													_height;
		osg::Vec4												_color;
		osg::ref_ptr<CoreBase::UserDefineShape>							_drawableShape;
	};
}